<!doctype html>
<html lang="zh">
<@block name="head">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">

    <script src="${base}/scripts/jquery.js"></script>
    <script src="${base}/scripts/semantic.min.js"></script>
    <link rel="stylesheet" href="${base}/themes/semantic.min.css">
    <link rel="stylesheet" href="${base}/themes/admin.css">
    <@block name="resources"></@block>
    <base href="${base}"/>
    <title><@block name="title">后台管理</@block></title>
    <@block name="style">
        <style>

        </style>
    </@block>
</head>
</@block>
<body>

<!--start sidebar -->
<div class="ui left sidebar vertical inverted menu accordion" id="sidebar">
<@block name="sidebar">
    <div class="item" id="menu-0">
        <a href="${base}/">主页</a>

    </div>
    <div class="item" id="menu-1">
        <a href="${base}/admin">管理首页</a>

    </div>
    <#if session.user.admin>
        <div class="item" id="menu-2">
            <div class="title">分类 <i class="dropdown icon"></i></div>
            <div class="content">
                <a class="item" href="${base}/admin/category/list">分类管理</a>
            </div>
        </div>
    </#if>
    <div class="item" id="menu-3">
        <div class="title">日志<i class="dropdown icon"></i></div>
        <div class="content">
            <a class="item" href="${base}/admin/post/add">发布日志</a>
            <a class="item">日志管理</a>
        </div>
    </div>

    <div class="item" id="menu-4">
        <div class="title">系统<i class="dropdown icon"></i></div>
        <div class="content">
            <a class="item"><i class="configure icon"></i>系统管理</a>
            <a class="item"><i class="user icon"></i>用户管理</a>
        </div>
    </div>
</@block>
</div> <!-- end sidebar-->
<div class="ui pusher" id="right-content">
<@block name="navbar">
    <div class="ui attached top inverted menu" id="navbar">
        <div class="ui container">
            <a class="header item" id="sidebar-toggler">
                <i class="sidebar icon"></i>菜单
            </a>
            <div class="ui right dropdown item">
                <i class="user icon"></i>
            ${(session.user.nickname)!''} <i class="dropdown icon"></i>
                <div class="menu">
                    <div class="item">修改密码</div>
                    <a href="${base}/logout" class="item">退出登录</a>
                </div>
            </div>
        </div>
    </div>
</@block>
    <div class="ui grid container" id="main-content">
    <@block name="main-content">
        <div class="sixteen wide column">
            <div class="ui segment">
                main content
            </div>
        </div>
    </@block>
    </div>
    <div class="ui vertical footer inverted segment" id="footer">
        <div class="ui center aligned text container">
            宁夏大学信息工程学院 2017
        </div>

    </div>
</div>

<@block name="additional"></@block>

</body>
<script>

    $(document).ready(function () {
        $("#sidebar-toggler").click(function () {
            $("#sidebar").sidebar("toggle");
        });

        var menuIdx = ${menuIdx!"1"};
        var menuId = "#menu-" + menuIdx;
        $(menuId).addClass("header");
        $(menuId + " .title").addClass("active");
        $(menuId + " .content").addClass("active");

        $(".ui.accordion").accordion();

        $(".ui.dropdown").dropdown();

    });
</script>
<@block name = "script">

</@block>

</html>